@extends('host.common.common')
@section('head')
    <script>
        var PAGE_DATA = {
            logo : "/assets/b2b/css/images/b2b-web-logo.png",
            modalCategoryData: undefined,
            modalBrandData : undefined,
            actionUrlB : "{{ route('register.purchaser') }}",
            actionUrlS : "{{ route('register.provider') }}",
            countyData : [
                {code:"100", text: "中国"},
                {code:"101", text: "美国"}
            ],
            provinceData : [
                {code:"200", text: "北京市"},
                {code:"201", text: "重庆市"},
                {code:"202", text: "云南省"}
            ],
            cityData : [
                {code:"300", text: "成都市"},
                {code:"301", text: "昆明市"},
                {code:"302", text: "aa区"}
            ],
            userAgreementUrl : "#120",
            supplyAgreementUrl : "#122"
        };

    </script>
    @stop

    @section('body')
            <!-- top_test -->
    <div id="top_test"></div>

    <div class="com-w">
        <div class="wrapper clearfix">
            <div class="fl">
                <img id="web-logo" src=""/>
            </div>
            <div class="fl comm-regist-title">
                账户注册
            </div>
        </div>
    </div>

    <form id="mainform" action="" method="post" enctype="multipart/form-data">
        @if(count($errors) > 0)
            @foreach($errors->all() as $error)
                <p>{{ $error }}</p>
            @endforeach
        @endif
        <!-- 账户信息 -->
        <div class="com-w mt20">
            <div class="wrapper clearfix">
                <div class="info-box-title">
                    <i class="icon-user"></i>
                    <span>填写账户信息</span>
                </div>
            </div>
        </div>

        <div class="com-w mt10">
            <div class="wrapper  comm-border-d clearfix" style="">
                <div class="comm-regist-info-line mt30">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="user">用户名 :</label>
                    </div>
                    <div class="input-info">
                        <input id="user" name="user" type="text" value="{{ old('user') }}"/>
                    </div>
                </div>

                <div class="comm-regist-info-line">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="password">密码 :</label>
                    </div>
                    <div class="input-info">
                        <input id="password" name="password" type="password"/>
                    </div>
                </div>

                <div class="comm-regist-info-line">
                    <div class="key-lbl">
                        <span for="password">密码强度 :</span>
                    </div>
                    <div class="input-info" id="pw-level">
                        <!-- pw-strength-chk -->
                        <div class="pw-strength-def pw-1 ">弱</div>
                        <div class="pw-strength-def pw-2 ">中</div>
                        <div class="pw-strength-def pw-3 ">强</div>
                        <input type="hidden" name="pwStrength" id="pwStrength"/>
                    </div>
                </div>

                <div class="comm-regist-info-line">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="password_confirmation">确认密码 :</label>
                    </div>
                    <div class="input-info">
                        <input id="password_confirmation" name="password_confirmation" type="password"/>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="email">电子邮箱 :</label>
                    </div>
                    <div class="input-info">
                        <input id="email" name="email" type="text" value="{{ old('email') }}" />
                    </div>
                </div>
            </div>
        </div>

        <!-- 供应商基本信息 -->

        <div class="com-w mt20">
            <div class="wrapper clearfix">
                <div class="info-box-title">
                    <i class="icon-pencil"></i>
                    <span>供应商基本信息</span>
                </div>
            </div>
        </div>
        <div class="com-w mt10">
            <div class="wrapper comm-border-d clearfix">
                <div class="comm-regist-info-line mt30">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="company">公司全称 :</label>
                    </div>
                    <div class="input-info">
                        <input id="company" name="company" type="text" value="{{ old('company') }}"/>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="legal">法人 :</label>
                    </div>
                    <div class="input-info">
                        <input id="legal" name="legal" type="text" value="{{ old('legal') }}"/>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="gender-0">性别 :</label>
                    </div>
                    <div class="input-info">
                        <label for="gender-1">
                            <input id="gender-1" name="legal_gender" type="radio" value="1" checked/>
                            先生
                        </label>
                        <label for="gender-0">
                            <input id="gender-0" name="legal_gender" type="radio" value="0"/>
                            女士
                        </label>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="corporateIdCardNo">法人身份证 :</label>
                    </div>
                    <div class="input-info">
                        <input id="corporateIdCardNo" name="identification_number" type="text" value="{{ old('identification_number') }}" />
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="contact_person">联系人姓名 :</label>
                    </div>
                    <div class="input-info">
                        <input id="contact_person" name="contact_person" type="text" value="{{ old('contact_person') }}" />
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="contact_phone">联系人电话 :</label>
                    </div>
                    <div class="input-info">
                        <input id="contact_phone" name="contact_phone" type="text" value="{{ old('contact_phone') }}" />
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="companyAddr">公司地址 :</label>
                    </div>
                    <div class="input-info">
                        <select id="province" name="province">
                            <option value="">请选择</option>
                        </select>
                        <select id="city" name="city">
                            <option value="">请选择</option>
                        </select>
                        <select id="country" name="county">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="address">详细地址 :</label>
                    </div>
                    <div class="input-info">
                        <input id="address" name="address" type="text" value="{{ old('address') }}" />
                    </div>
                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="">主营类别 :</label>
                    </div>
                    <div class="input-info">
                        <div id="category-btn" class="btn btn-default btn-200x32">选择主营类别</div>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10 comm-regist-line-h60">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="">已选类别 :</label>
                    </div>

                    <div class="input-info">
                        <div id="sel-categ-box" class="input-info w500 h60 comm-border-d"
                             style="overflow-y: scroll;">
                        </div>
                        <input name="main_category" id="main_category" type="hidden" value=""/>
                    </div>

                </div>

                <div class="comm-regist-info-line mt10">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="">主营品牌 :</label>

                    </div>
                    <div class="input-info">
                        <div id="brand-btn" class="btn btn-default btn-200x32">选择主营品牌</div>
                    </div>
                </div>

                <div class="comm-regist-info-line mt10 comm-regist-line-h60">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="">已选品牌 :</label>

                    </div>

                    <div class="input-info">
                        <div id="sel-brand-box" class="input-info w500 h60 comm-border-d"
                             style="overflow-y: scroll;"></div>
                        <input name="main_brand" type="hidden" id="main_brand"/>
                    </div>

                </div>

                <div class="comm-regist-info-line mt10 comm-regist-line-h60">
                    <div class="key-lbl">
                        <span class="f-red">*</span>
                        <label for="captcha">验证码 :</label>
                        <img src="{{ route('captcha.generate') }}" onclick="this.src='{{ route('captcha.generate') }}?v=' + Math.random() * 10">
                    </div>

                    <div class="input-info" style="position: relative;top: 15px;min-width: 100px!important;height: 30px;">
                        <input id="captcha" name="captcha" type="text" style="width: 100px;" />
                        <img id="captchaimg" src=""/>
                    </div>

                </div>

            </div>
        </div>

        <!-- 电子文件 -->
        <div class="com-w mt20">
            <div class="wrapper clearfix">
                <div class="info-box-title">
                    <i class="icon-print"></i>
                    <span>电子文件</span>
                </div>
            </div>
        </div>
        <div class="com-w mt10">

            <div class="wrapper  comm-border-d clearfix electronic" style="height:580px">

                <div class="regist-role" id="regist-role">
                    <span role="0" class="current">供应商</span> | <span role="1">采购商</span>
                    <input type="hidden"/>
                </div>

                <div class="upload-image clearfix" id="regist-elec-docs">
                    <div class="image-list" id="aa">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            身份证（正面）
                        </div>
                        <input type="file" style="display: none;" name="legal_identity_a" id="legal_identity_a"/>
                    </div>
                    <div class="image-list">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            身份证（反面）
                        </div>
                        <input type="file" style="display: none;" name="legal_identity_b" id="legal_identity_b"/>
                    </div>
                    <div class="image-list">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            营业执照副本
                        </div>
                        <input type="file" style="display: none;" name="business_license" id="business_license"/>
                    </div>

                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            税务登记证
                        </div>
                        <input type="file" style="display: none;" name="tax_registration" id="tax_registration"/>
                    </div>
                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            组织机构代码证
                        </div>
                        <input type="file" style="display: none;" name="organization_code_cert"
                               id="organization_code_cert"/>
                    </div>

                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src="" />
                        </div>
                        <div class="img-text">
                            店铺logo
                        </div>
                        <input type="file" style="display: none;" name="store_logo" id="store_logo" />
                    </div>

                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            授权书1
                        </div>
                        <input type="file" style="display: none;" name="authorization[]" id="authorization"/>
                    </div>
                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            授权书2
                        </div>
                        <input type="file" style="display: none;" name="authorization[]" id="authorization"/>
                    </div>
                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            授权书3
                        </div>
                        <input type="file" style="display: none;" name="authorization[]" id="authorization"/>
                    </div>
                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            授权书4
                        </div>
                        <input type="file" style="display: none;" name="authorization[]" id="authorization"/>
                    </div>
                    <div class="image-list sel-doc-more">
                        <div class="img">
                            <img src=""/>
                        </div>
                        <div class="img-text">
                            授权书5
                        </div>
                        <input type="file" style="display: none;" name="authorization[]" id="authorization"/>
                    </div>

                    <div class="electronic-prompt">
                        提示：每张图片大小不超过2M，支持png、jpg、gif、bmp格式文件
                    </div>
                </div>
                <div class="electronic-bottom">
                    <span class="electronic-bottom-l"><input id="signflag" type="checkbox" name="signflag"/></span>
                    <label for="signflag">我已阅读并接受</label>
            <span id="agreement-file">
            <a id="supply-agreement" class="coofee-shop" href="">《咖啡商谷供销平台供应商入驻协议》</a>及
            </span>
                    <a id="user-agreement" href="" class="coofee-shop">《咖啡商谷入住平台用户注册协议》</a>

                    <div id="form-submit-btn" class="btn btn-important btn-w200x50">提交申请</div>
                </div>
            </div>
        </div>
        {{ csrf_field() }}
    </form>

    <!-- foot_nav -->
    <div id="foot_nav"></div>
    <div id="bottom_main"></div>


    <!-- template -->


    <script type="text/template" id="item-template">

        <div class='dialog-div'>
            <div class='regist-left-box mr10'>
                <% var tmpIdx = 0; %>
                <% _.each(obj, function(item){%>
                <div class='info-item' id='info-item-title-<%=tmpIdx %>'>
                    <div class='content-box'>
                        <%=item.categTitle%>
                    </div>
                    <div class='icon-box'>
                        <i class='icon-angle-right'></i>
                    </div>
                </div>
                <% tmpIdx++ %>
                <% });%>

            </div>
            <div class='regist-right-box'>
                <% var tmpIdx2=0 %>
                <% var tmpIdx3=0 %>
                <% _.each(obj, function(item){ %>
                <div class="info-detail-box" id="info-detail-box-<%=tmpIdx2%>">
                    <% _.each(item.categDetail, function(itemDetail){%>
                    <label for="detail-item-<%=tmpIdx3%>">
                        <input id="detail-item-<%=tmpIdx3%>" type="checkbox"
                               code="<%=itemDetail.code%>" txt="<%=itemDetail.txt%>"/><%=itemDetail.txt%>
                    </label>
                    <% tmpIdx3++ %>
                    <% });%>
                </div>
                <% tmpIdx2++ %>
                <% });%>

            </div>
            <div>
                <div id="modal-save-btn" class="btn btn-warn btn-w70x30 fr mt10 mb10">保存</div>
            </div>
        </div>

    </script>

    <script type="text/template" id="sel-item-templ">
        <% _.each(obj, function(item){%>
        <div class="sel-item"><%=item %>
        </div>
        <% });%>
    </script>

    <script type="text/template" id="addr-option-templ">
        <option value="">请选择</option>
        <% _.each(obj, function(item){%>
        <option value="<%=item.code %>"><%=item.text %></option>
        <% }); %>
    </script>


    <script src="/assets/b2b/js/libs/jquery.validate.min.js"></script>
    <script src="/assets/b2b/js/libs/messages_zh.js"></script>
    <script src="/assets/b2b/js/libs/dialog-min.js"></script>
    <script src="/assets/b2b/js/libs/jquery.ajaxfileupload.js"></script>

    <script src="/assets/b2b/js/pageModules/buyer/regist.js"></script>

@stop